home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume14 / dmake / part02 < prev    next >
Encoding:
Text File  |  1990-07-26  |  39.4 KB  |  1,281 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v14i012: dmake version 3.5 part 2/21
  3. From: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 12
  7. Submitted-by: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  8. Archive-name: dmake/part02
  9.  
  10. #!/bin/sh
  11. # this is part 2 of a multipart archive
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file unix/config.mk continued
  14. #
  15. CurArch=2
  16. if test ! -r s2_seq_.tmp
  17. then echo "Please unpack part 1 first!"
  18.      exit 1; fi
  19. ( read Scheck
  20.   if test "$Scheck" != $CurArch
  21.   then echo "Please unpack part $Scheck next!"
  22.        exit 1;
  23.   else exit 0; fi
  24. ) < s2_seq_.tmp || exit 1
  25. echo "x - Continuing file unix/config.mk"
  26. sed 's/^X//' << 'SHAR_EOF' >> unix/config.mk
  27. X.END
  28. X
  29. X# Set the proper macros based on whether we are making the debugging version
  30. X# or not.
  31. X.IF $(DEBUG)
  32. X   CFLAGS    += $(DB_CFLAGS)
  33. X   LDFLAGS    += $(DB_LDFLAGS)
  34. X   LDLIBS    += $(DB_LDLIBS)
  35. X
  36. X   SILENT    := $(.SILENT)
  37. X   .SILENT    := yes
  38. X   TARGET    := db$(TARGET)
  39. X   OBJDIR    := $(OBJDIR).dbg
  40. X   .SILENT    := $(SILENT)
  41. X
  42. X    SRC        += dbug.c malloc.c
  43. X    HDR        += db.h 
  44. X    .SETDIR=common : dbug.c malloc.c
  45. X.ELSE
  46. X   CFLAGS    += $(NDB_CFLAGS)
  47. X   LDFLAGS    += $(NDB_LDFLAGS)
  48. X   LDLIBS    += $(NDB_LDLIBS)
  49. X.END
  50. SHAR_EOF
  51. echo "File unix/config.mk is complete"
  52. chmod 0640 unix/config.mk || echo "restore of unix/config.mk fails"
  53. echo mkdir - unix/bsd43
  54. mkdir unix/bsd43
  55. echo mkdir - unix/bsd43/uw
  56. mkdir unix/bsd43/uw
  57. echo "x - extracting unix/bsd43/uw/startup.mk (Text)"
  58. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/startup.mk &&
  59. X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
  60. X# Should work for both SYSV, and BSD 4.3
  61. X# See the documentation for a description of internally defined macros.
  62. X#
  63. X# Disable warnings for macros redefined here that were given
  64. X# on the command line.
  65. X__.SILENT := $(.SILENT)
  66. X.SILENT   := yes
  67. X
  68. X# Configuration parameters for DMAKE startup.mk file
  69. X# Set these to NON-NULL if you wish to turn the parameter on.
  70. X_HAVE_RCS    := yes        # yes => RCS  is installed.
  71. X_HAVE_SCCS    := yes        # yes => SCCS is installed.
  72. X
  73. X# Applicable suffix definitions
  74. XA := .a        # Libraries
  75. XE :=        # Executables
  76. XF := .f        # Fortran
  77. XO := .o        # Objects
  78. XP := .p        # Pascal
  79. XS := .s        # Assembler sources
  80. XV := ,v        # RCS suffix
  81. X
  82. X# Recipe execution configurations
  83. XSHELL        := /bin/sh
  84. XSHELLFLAGS    := -ce
  85. XGROUPSHELL    := $(SHELL)
  86. XGROUPFLAGS    := 
  87. XSHELLMETAS    := |();&<>?*][$$:\\#`'"
  88. XGROUPSUFFIX    :=
  89. X
  90. X# Standard C-language command names and flags
  91. X   CPP       := /lib/cpp        # C-preprocessor
  92. X   CC      := cc        # C-compiler and flags
  93. X   CFLAGS   =
  94. X
  95. X   AS      := as        # Assembler and flags
  96. X   ASFLAGS  = 
  97. X
  98. X   LD       = $(CC)        # Loader and flags
  99. X   LDFLAGS  =
  100. X   LDLIBS   =
  101. X
  102. X# Definition of $(MAKE) macro for recursive makes.
  103. X   MAKE = $(MAKECMD) $(MFLAGS)
  104. X
  105. X# Definition of Print command for this system.
  106. X   PRINT = lpr
  107. X
  108. X# Language and Parser generation Tools and their flags
  109. X   YACC      := yacc        # standard yacc
  110. X   YFLAGS  =
  111. X   YTAB      := y.tab        # yacc output files name stem.
  112. X
  113. X   LEX      := lex        # standard lex
  114. X   LFLAGS  =
  115. X   LEXYY  := lex.yy        # lex output file
  116. X
  117. X# Other Compilers, Tools and their flags
  118. X   PC    := pc            # pascal compiler
  119. X   RC    := f77            # ratfor compiler
  120. X   FC    := f77            # fortran compiler
  121. X
  122. X   CO       := co        # check out for RCS
  123. X   COFLAGS := -q
  124. X
  125. X   AR     := ar            # archiver
  126. X   ARFLAGS = ruv
  127. X
  128. X   RM       := /bin/rm        # remove a file command
  129. X   RMFLAGS  =
  130. X
  131. X# Implicit generation rules for making inferences.
  132. X# We don't provide .yr or .ye rules here.  They're obsolete.
  133. X# Rules for making *$O
  134. X   %$O : %.c ; $(CC) -o $@ $(CFLAGS) -c $<
  135. X   %$O : %$P ; $(PC) -o $@ $(PFLAGS) -c $<
  136. X   %$O : %$S ; $(AS) -o $@ $<
  137. X   %$O : %.cl ; class -c $<
  138. X   %$O : %.e %.r %.F %$F
  139. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  140. X
  141. X# Executables
  142. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  143. X
  144. X# lex and yacc rules
  145. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  146. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  147. X
  148. X# This rule tells how to make *.out from it's immediate list of prerequisites
  149. X# UNIX only.
  150. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  151. X
  152. X# RCS support
  153. X.IF $(_HAVE_RCS)
  154. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  155. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  156. X.END
  157. X
  158. X# SCCS support
  159. X.IF $(_HAVE_SCCS)
  160. X   % : s.% ; get $@
  161. X   .NOINFER : s.%
  162. X.END
  163. X
  164. X# Recipe to make archive files.
  165. X%$A :
  166. X[
  167. X   $(AR) $(ARFLAGS) $@ $?
  168. X   $(RM) $(RMFLAGS) $?
  169. X   ranlib $@
  170. X]
  171. X
  172. X# DMAKE uses this recipe to remove intermediate targets
  173. X.REMOVE :; $(RM) -f $<
  174. X
  175. X# AUGMAKE extensions for SYSV compatibility
  176. X@B = $(@:b)
  177. X@D = $(@:d)
  178. X@F = $(@:f)
  179. X*B = $(*:b)
  180. X*D = $(*:d)
  181. X*F = $(*:f)
  182. X<B = $(<:b)
  183. X<D = $(<:d)
  184. X<F = $(<:f)
  185. X?B = $(?:b)
  186. X?F = $(?:f)
  187. X?D = $(?:d)
  188. X
  189. X# Turn warnings back to previous setting.
  190. X.SILENT := $(__.SILENT)
  191. X
  192. X# Local startup file if any
  193. X.INCLUDE .IGNORE: "_startup.mk"
  194. SHAR_EOF
  195. chmod 0640 unix/bsd43/uw/startup.mk || echo "restore of unix/bsd43/uw/startup.mk fails"
  196. echo "x - extracting unix/bsd43/uw/make.sh (Text)"
  197. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/make.sh &&
  198. Xmkdir objects
  199. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O infer.c
  200. Xmv infer.o objects
  201. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O make.c
  202. Xmv make.o objects
  203. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O stat.c
  204. Xmv stat.o objects
  205. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O expand.c
  206. Xmv expand.o objects
  207. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O string.c
  208. Xmv string.o objects
  209. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O hash.c
  210. Xmv hash.o objects
  211. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dag.c
  212. Xmv dag.o objects
  213. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dmake.c
  214. Xmv dmake.o objects
  215. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O path.c
  216. Xmv path.o objects
  217. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O imacs.c
  218. Xmv imacs.o objects
  219. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O sysintf.c
  220. Xmv sysintf.o objects
  221. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O parse.c
  222. Xmv parse.o objects
  223. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O getinp.c
  224. Xmv getinp.o objects
  225. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O quit.c
  226. Xmv quit.o objects
  227. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O basename.c
  228. Xmv basename.o objects
  229. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dump.c
  230. Xmv dump.o objects
  231. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O macparse.c
  232. Xmv macparse.o objects
  233. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O rulparse.c
  234. Xmv rulparse.o objects
  235. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O percent.c
  236. Xmv percent.o objects
  237. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/arlib.c
  238. Xmv arlib.o objects
  239. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/dirbrk.c
  240. Xmv dirbrk.o objects
  241. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/explode.c
  242. Xmv explode.o objects
  243. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/rmprq.c
  244. Xmv rmprq.o objects
  245. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/ruletab.c
  246. Xmv ruletab.o objects
  247. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/runargv.c
  248. Xmv runargv.o objects
  249. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c
  250. Xmv putenv.o objects
  251. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c
  252. Xmv tempnam.o objects
  253. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c
  254. Xmv utime.o objects
  255. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c
  256. Xmv setvbuf.o objects
  257. Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -luw 
  258. SHAR_EOF
  259. chmod 0640 unix/bsd43/uw/make.sh || echo "restore of unix/bsd43/uw/make.sh fails"
  260. echo "x - extracting unix/bsd43/uw/config.mk (Text)"
  261. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/config.mk &&
  262. X# This is the BSD 4.3 University of Waterloo (uw) UNIX configuration file
  263. X# for DMAKE
  264. X#    It simply modifies the values of LDLIBS to include libuw.a
  265. X#    so that vfprintf can be found.
  266. X#
  267. X
  268. XLDLIBS += -luw
  269. X
  270. X# install script for UW's /usr/software hierarchy...
  271. Xinstall:
  272. X    mkdir ../bin; strip ./dmake; mv ./dmake ../bin
  273. X    chmod a+rx ../bin/dmake ../bin
  274. X    mkdir ../lib; chmod a+rx ../lib
  275. X    cp $(STARTUPFILE) ../lib
  276. X    chmod a+r ../lib/startup.mk
  277. SHAR_EOF
  278. chmod 0640 unix/bsd43/uw/config.mk || echo "restore of unix/bsd43/uw/config.mk fails"
  279. echo "x - extracting unix/bsd43/utime.c (Text)"
  280. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/utime.c &&
  281. X/*
  282. X** change access and modify times of file
  283. X*/
  284. X#include <sys/types.h>
  285. X#include <sys/time.h>
  286. X#include <sys/stat.h>
  287. X#include <sys/file.h>
  288. X
  289. Xint
  290. Xutime(name, timep)
  291. Xchar*    name;
  292. Xtime_t    timep[2];
  293. X{
  294. X    struct timeval tv[2], *tvp;
  295. X    struct stat buf;
  296. X    int    fil;
  297. X    char    data;
  298. X
  299. X    if (timep!=0)
  300. X    {
  301. X        tvp = tv, tv[0].tv_sec = timep[0], tv[1].tv_sec = timep[1];
  302. X        if (utimes(name, tvp)==0)
  303. X            return (0);
  304. X    }
  305. X
  306. X    if (stat(name, &buf) != 0)
  307. X        return (-1);
  308. X    if (buf.st_size != 0)  {
  309. X        if ((fil = open(name, O_RDWR, 0666)) < 0)
  310. X            return (-1);
  311. X        if (read(fil, &data, 1) < 1) {
  312. X            close(fil);
  313. X            return (-1);
  314. X        }
  315. X        lseek(fil, 0L, 0);
  316. X        if (write(fil, &data, 1) < 1) {
  317. X            close(fil);
  318. X            return (-1);
  319. X        }
  320. X        close(fil);
  321. X        return (0);
  322. X    } else     if ((fil = creat(name, 0666)) < 0) {
  323. X        return (-1);
  324. X    } else {
  325. X        close(fil);
  326. X        return (0);
  327. X    }
  328. X}
  329. SHAR_EOF
  330. chmod 0640 unix/bsd43/utime.c || echo "restore of unix/bsd43/utime.c fails"
  331. echo "x - extracting unix/bsd43/tempnam.c (Text)"
  332. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/tempnam.c &&
  333. X/*LINTLIBRARY*/
  334. X#include <stdio.h>
  335. X#include <string.h>
  336. X#include <stdlib.h>
  337. X
  338. X#define max(A,B) (((A)<(B))?(B):(A))
  339. X
  340. Xextern char *mktemp();
  341. Xextern int access();
  342. X
  343. Xstatic char *cpdir();
  344. Xstatic char  *seed="AAA";
  345. X
  346. X/* BSD stdio.h doesn't define P_tmpdir, so let's do it here */
  347. X#ifndef P_tmpdir
  348. Xstatic char *P_tmpdir = "/tmp";
  349. X#endif
  350. X
  351. Xchar *
  352. Xtempnam(dir, prefix)
  353. Xchar *dir;        /* use this directory please (if non-NULL) */
  354. Xchar *prefix;        /* use this (if non-NULL) as filename prefix */
  355. X{
  356. X   register char *p, *q, *tmpdir;
  357. X   int            tl=0, dl=0, pl;
  358. X
  359. X   pl = strlen(P_tmpdir);
  360. X
  361. X   if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
  362. X   if( dir != NULL ) dl = strlen(dir);
  363. X
  364. X   if( (p = malloc((unsigned)(max(max(dl,tl),pl)+16))) == NULL )
  365. X     return(NULL);
  366. X
  367. X   *p = '\0';
  368. X
  369. X   if( (tl == 0) || (access( cpdir(p, tmpdir), 3) != 0) )
  370. X     if( (dl == 0) || (access( cpdir(p, dir), 3) != 0) )
  371. X    if( access( cpdir(p, P_tmpdir),   3) != 0 )
  372. X       if( access( cpdir(p, "/tmp"),  3) != 0 )
  373. X          return(NULL);
  374. X
  375. X   (void) strcat(p, "/");
  376. X   if(prefix)
  377. X   {
  378. X      *(p+strlen(p)+5) = '\0';
  379. X      (void)strncat(p, prefix, 5);
  380. X   }
  381. X
  382. X   (void)strcat(p, seed);
  383. X   (void)strcat(p, "XXXXXX");
  384. X
  385. X   q = seed;
  386. X   while(*q == 'Z') *q++ = 'A';
  387. X   ++*q;
  388. X
  389. X   if(*mktemp(p) == '\0') return(NULL);
  390. X   return(p);
  391. X}
  392. X
  393. X
  394. X
  395. Xstatic char *
  396. Xcpdir(buf, str)
  397. Xchar *buf;
  398. Xchar *str;
  399. X{
  400. X   char *p;
  401. X
  402. X   if(str != NULL)
  403. X   {
  404. X      (void) strcpy(buf, str);
  405. X      p = buf - 1 + strlen(buf);
  406. X      if(*p == '/') *p = '\0';
  407. X   }
  408. X
  409. X   return(buf);
  410. X}
  411. SHAR_EOF
  412. chmod 0640 unix/bsd43/tempnam.c || echo "restore of unix/bsd43/tempnam.c fails"
  413. echo "x - extracting unix/bsd43/string.h (Text)"
  414. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/string.h &&
  415. X/*
  416. X** BSD does this wrong
  417. X*/
  418. X#include <strings.h>
  419. X
  420. X#define    strchr(str,c)    index(str,c)
  421. X#define    strrchr(str,c)    rindex(str,c)
  422. X
  423. X#include "macros.h"
  424. Xextern    char*    strpbrk ANSI((char* src, char* any));
  425. X
  426. SHAR_EOF
  427. chmod 0640 unix/bsd43/string.h || echo "restore of unix/bsd43/string.h fails"
  428. echo "x - extracting unix/bsd43/stdlib.h (Text)"
  429. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/stdlib.h &&
  430. X#ifndef _STDLIB_INCLUDED_
  431. X#define _STDLIB_INCLUDED_
  432. X
  433. Xextern /*GOTO*/ _exit();
  434. Xextern /*GOTO*/ exit();
  435. Xextern /*GOTO*/ abort();
  436. Xextern int system();
  437. Xextern char *getenv();
  438. Xextern char *calloc();
  439. Xextern char *malloc();
  440. Xextern char *realloc();
  441. Xextern free();
  442. Xextern int errno;
  443. X
  444. X#ifndef EIO
  445. X#    include <errno.h>
  446. X#endif
  447. X
  448. X#endif /* _STDLIB_INCLUDED_ */
  449. SHAR_EOF
  450. chmod 0640 unix/bsd43/stdlib.h || echo "restore of unix/bsd43/stdlib.h fails"
  451. echo "x - extracting unix/bsd43/stdarg.h (Text)"
  452. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/stdarg.h &&
  453. X/*
  454. X * stdarg.h
  455. X *
  456. X * defines ANSI style macros for accessing arguments of a function which takes
  457. X * a variable number of arguments
  458. X *
  459. X */
  460. X
  461. Xtypedef char *va_list;
  462. X
  463. X#if defined(sparc)
  464. X# define va_alist __builtin_va_alist
  465. X#endif
  466. X# define va_dcl int va_alist
  467. X# define va_start(list,v) list = (char *)&va_alist
  468. X# define va_end(list)     list = NULL
  469. X# define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
  470. X
  471. SHAR_EOF
  472. chmod 0640 unix/bsd43/stdarg.h || echo "restore of unix/bsd43/stdarg.h fails"
  473. echo "x - extracting unix/bsd43/startup.mk (Text)"
  474. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/startup.mk &&
  475. X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
  476. X# Should work for both SYSV, and BSD 4.3
  477. X# See the documentation for a description of internally defined macros.
  478. X#
  479. X# Disable warnings for macros redefined here that were given
  480. X# on the command line.
  481. X__.SILENT := $(.SILENT)
  482. X.SILENT   := yes
  483. X
  484. X# Configuration parameters for DMAKE startup.mk file
  485. X# Set these to NON-NULL if you wish to turn the parameter on.
  486. X_HAVE_RCS    := yes        # yes => RCS  is installed.
  487. X_HAVE_SCCS    := yes        # yes => SCCS is installed.
  488. X
  489. X# Applicable suffix definitions
  490. XA := .a        # Libraries
  491. XE :=        # Executables
  492. XF := .f        # Fortran
  493. XO := .o        # Objects
  494. XP := .p        # Pascal
  495. XS := .s        # Assembler sources
  496. XV := ,v        # RCS suffix
  497. X
  498. X# Recipe execution configurations
  499. XSHELL        := /bin/sh
  500. XSHELLFLAGS    := -ce
  501. XGROUPSHELL    := $(SHELL)
  502. XGROUPFLAGS    := 
  503. XSHELLMETAS    := |();&<>?*][$$:\\#`'"
  504. XGROUPSUFFIX    :=
  505. X
  506. X# Standard C-language command names and flags
  507. X   CPP       := /lib/cpp        # C-preprocessor
  508. X   CC      := cc        # C-compiler and flags
  509. X   CFLAGS   =
  510. X
  511. X   AS      := as        # Assembler and flags
  512. X   ASFLAGS  = 
  513. X
  514. X   LD       = $(CC)        # Loader and flags
  515. X   LDFLAGS  =
  516. X   LDLIBS   =
  517. X
  518. X# Definition of $(MAKE) macro for recursive makes.
  519. X   MAKE = $(MAKECMD) $(MFLAGS)
  520. X
  521. X# Definition of Print command for this system.
  522. X   PRINT = lpr
  523. X
  524. X# Language and Parser generation Tools and their flags
  525. X   YACC      := yacc        # standard yacc
  526. X   YFLAGS  =
  527. X   YTAB      := y.tab        # yacc output files name stem.
  528. X
  529. X   LEX      := lex        # standard lex
  530. X   LFLAGS  =
  531. X   LEXYY  := lex.yy        # lex output file
  532. X
  533. X# Other Compilers, Tools and their flags
  534. X   PC    := pc            # pascal compiler
  535. X   RC    := f77            # ratfor compiler
  536. X   FC    := f77            # fortran compiler
  537. X
  538. X   CO       := co        # check out for RCS
  539. X   COFLAGS := -q
  540. X
  541. X   AR     := ar            # archiver
  542. X   ARFLAGS = ruv
  543. X
  544. X   RM       := /bin/rm        # remove a file command
  545. X   RMFLAGS  =
  546. X
  547. X# Implicit generation rules for making inferences.
  548. X# We don't provide .yr or .ye rules here.  They're obsolete.
  549. X# Rules for making *$O
  550. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  551. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  552. X   %$O : %$S ; $(AS) $<
  553. X   %$O : %.cl ; class -c $<
  554. X   %$O : %.e %.r %.F %$F
  555. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  556. X
  557. X# Executables
  558. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  559. X
  560. X# lex and yacc rules
  561. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  562. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  563. X
  564. X# This rule tells how to make *.out from it's immediate list of prerequisites
  565. X# UNIX only.
  566. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  567. X
  568. X# RCS support
  569. X.IF $(_HAVE_RCS)
  570. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  571. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  572. X.END
  573. X
  574. X# SCCS support
  575. X.IF $(_HAVE_SCCS)
  576. X   % : s.% ; get $@
  577. X   .NOINFER : s.%
  578. X.END
  579. X
  580. X# Recipe to make archive files.
  581. X%$A :
  582. X[
  583. X   $(AR) $(ARFLAGS) $@ $?
  584. X   $(RM) $(RMFLAGS) $?
  585. X   ranlib $@
  586. X]
  587. X
  588. X# DMAKE uses this recipe to remove intermediate targets
  589. X.REMOVE :; $(RM) -f $<
  590. X
  591. X# AUGMAKE extensions for SYSV compatibility
  592. X@B = $(@:b)
  593. X@D = $(@:d)
  594. X@F = $(@:f)
  595. X*B = $(*:b)
  596. X*D = $(*:d)
  597. X*F = $(*:f)
  598. X<B = $(<:b)
  599. X<D = $(<:d)
  600. X<F = $(<:f)
  601. X?B = $(?:b)
  602. X?F = $(?:f)
  603. X?D = $(?:d)
  604. X
  605. X# Turn warnings back to previous setting.
  606. X.SILENT := $(__.SILENT)
  607. X
  608. X# Local startup file if any
  609. X.INCLUDE .IGNORE: "_startup.mk"
  610. SHAR_EOF
  611. chmod 0640 unix/bsd43/startup.mk || echo "restore of unix/bsd43/startup.mk fails"
  612. echo "x - extracting unix/bsd43/setvbuf.c (Text)"
  613. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/setvbuf.c &&
  614. X/* RCS      -- $Header$
  615. X-- SYNOPSIS -- setvbuf for BSD
  616. X-- 
  617. X-- DESCRIPTION
  618. X--     A sysv call, standard BSD doesn't have this.
  619. X--
  620. X-- AUTHOR
  621. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  622. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  623. X--
  624. X-- COPYRIGHT
  625. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  626. X-- 
  627. X--      This program is free software; you can redistribute it and/or
  628. X--      modify it under the terms of the GNU General Public License
  629. X--      (version 1), as published by the Free Software Foundation, and
  630. X--      found in the file 'LICENSE' included with this distribution.
  631. X-- 
  632. X--      This program is distributed in the hope that it will be useful,
  633. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  634. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  635. X--      GNU General Public License for more details.
  636. X-- 
  637. X--      You should have received a copy of the GNU General Public License
  638. X--      along with this program;  if not, write to the Free Software
  639. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  640. X--
  641. X-- LOG
  642. X--     $Log$
  643. X*/
  644. X
  645. X#include <stdio.h>
  646. X
  647. Xsetvbuf(fp, bp, type, len_unused)
  648. XFILE*    fp;
  649. Xchar*    bp;
  650. Xint    type;
  651. Xint    len_unused;
  652. X{
  653. X    switch (type) {
  654. X    case _IOLBF: setlinebuf(fp);   return;
  655. X    case _IONBF: setbuf(fp, NULL); return;
  656. X    default:     setbuf(fp, bp);   return;
  657. X    }
  658. X}
  659. X
  660. SHAR_EOF
  661. chmod 0640 unix/bsd43/setvbuf.c || echo "restore of unix/bsd43/setvbuf.c fails"
  662. echo "x - extracting unix/bsd43/putenv.c (Text)"
  663. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/putenv.c &&
  664. X/* RCS      -- $Header$
  665. X-- SYNOPSIS -- our own putenv for BSD systems.
  666. X-- 
  667. X-- DESCRIPTION
  668. X--     This originally came from MKS.
  669. X--
  670. X-- AUTHOR
  671. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  672. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  673. X--
  674. X-- COPYRIGHT
  675. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  676. X-- 
  677. X--      This program is free software; you can redistribute it and/or
  678. X--      modify it under the terms of the GNU General Public License
  679. X--      (version 1), as published by the Free Software Foundation, and
  680. X--      found in the file 'LICENSE' included with this distribution.
  681. X-- 
  682. X--      This program is distributed in the hope that it will be useful,
  683. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  684. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  685. X--      GNU General Public License for more details.
  686. X-- 
  687. X--      You should have received a copy of the GNU General Public License
  688. X--      along with this program;  if not, write to the Free Software
  689. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  690. X--
  691. X-- LOG
  692. X--     $Log$
  693. X*/
  694. X
  695. X/*
  696. X * System V.2 Emulation Library.
  697. X * Copyright (c) 1985 by Mortice Kern Systems, Inc.
  698. X *
  699. X * putenv -- C library.
  700. X */
  701. X
  702. X#include <string.h>
  703. X
  704. X#ifndef    NULL
  705. X#define    NULL    0
  706. X#endif    NULL
  707. X
  708. X/*
  709. X * Put a string containing "name=value" into the environment.
  710. X * The space pointed to by the string is put into the environment
  711. X * so it should be static or malloc'd.
  712. X * Return 0 if OK, non-zero otherwise.
  713. X */
  714. Xint
  715. Xputenv(string)
  716. Xchar *string;
  717. X{
  718. X    extern char **environ;
  719. X    static char **ourenv = NULL;
  720. X    register char *ep;
  721. X    register char **epp;
  722. X
  723. X    for (epp = environ; (ep = *epp) != NULL; epp++) {
  724. X        register char *np;
  725. X        register int c;
  726. X
  727. X        np = string;
  728. X        while ((c = *ep++) == *np++)
  729. X            if (c == '\0')
  730. X                break;
  731. X        if (c=='=' || c=='\0') {
  732. X            *epp = string;
  733. X            return (0);
  734. X        }
  735. X    }
  736. X    if (environ != ourenv) {
  737. X        int neb = (epp-environ+1) * sizeof(char*);
  738. X
  739. X        ourenv = (char**) malloc(neb);
  740. X        if (ourenv == NULL)
  741. X            return 1;
  742. X        memcpy((char*)ourenv, (char*)environ, neb);
  743. X        epp = ourenv + (epp-environ);
  744. X        environ = ourenv;
  745. X    }
  746. X    ourenv = (char**) realloc(environ, (epp-environ+2) * sizeof(char*));
  747. X    if (ourenv == NULL)
  748. X        return 1;
  749. X    epp = ourenv + (epp-environ);
  750. X    *epp++ = string;
  751. X    *epp = NULL;
  752. X    environ = ourenv;
  753. X    return (0);
  754. X}
  755. X
  756. SHAR_EOF
  757. chmod 0640 unix/bsd43/putenv.c || echo "restore of unix/bsd43/putenv.c fails"
  758. echo "x - extracting unix/bsd43/make.sh (Text)"
  759. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/make.sh &&
  760. Xmkdir objects
  761. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O infer.c
  762. Xmv infer.o objects
  763. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O make.c
  764. Xmv make.o objects
  765. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O stat.c
  766. Xmv stat.o objects
  767. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O expand.c
  768. Xmv expand.o objects
  769. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O string.c
  770. Xmv string.o objects
  771. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O hash.c
  772. Xmv hash.o objects
  773. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dag.c
  774. Xmv dag.o objects
  775. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dmake.c
  776. Xmv dmake.o objects
  777. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O path.c
  778. Xmv path.o objects
  779. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O imacs.c
  780. Xmv imacs.o objects
  781. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O sysintf.c
  782. Xmv sysintf.o objects
  783. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O parse.c
  784. Xmv parse.o objects
  785. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O getinp.c
  786. Xmv getinp.o objects
  787. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O quit.c
  788. Xmv quit.o objects
  789. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O basename.c
  790. Xmv basename.o objects
  791. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O dump.c
  792. Xmv dump.o objects
  793. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O macparse.c
  794. Xmv macparse.o objects
  795. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O rulparse.c
  796. Xmv rulparse.o objects
  797. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O percent.c
  798. Xmv percent.o objects
  799. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/arlib.c
  800. Xmv arlib.o objects
  801. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/dirbrk.c
  802. Xmv dirbrk.o objects
  803. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/explode.c
  804. Xmv explode.o objects
  805. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/rmprq.c
  806. Xmv rmprq.o objects
  807. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/ruletab.c
  808. Xmv ruletab.o objects
  809. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/runargv.c
  810. Xmv runargv.o objects
  811. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/putenv.c
  812. Xmv putenv.o objects
  813. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/tempnam.c
  814. Xmv tempnam.o objects
  815. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/utime.c
  816. Xmv utime.o objects
  817. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -O unix/bsd43/setvbuf.c
  818. Xmv setvbuf.o objects
  819. Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o 
  820. SHAR_EOF
  821. chmod 0640 unix/bsd43/make.sh || echo "restore of unix/bsd43/make.sh fails"
  822. echo mkdir - unix/bsd43/dynix
  823. mkdir unix/bsd43/dynix
  824. echo "x - extracting unix/bsd43/dynix/startup.mk (Text)"
  825. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/startup.mk &&
  826. X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
  827. X# Should work for both SYSV, and BSD 4.3
  828. X# See the documentation for a description of internally defined macros.
  829. X#
  830. X# Disable warnings for macros redefined here that were given
  831. X# on the command line.
  832. X__.SILENT := $(.SILENT)
  833. X.SILENT   := yes
  834. X
  835. X# Configuration parameters for DMAKE startup.mk file
  836. X# Set these to NON-NULL if you wish to turn the parameter on.
  837. X_HAVE_RCS    := yes        # yes => RCS  is installed.
  838. X_HAVE_SCCS    := yes        # yes => SCCS is installed.
  839. X
  840. X# Applicable suffix definitions
  841. XA := .a        # Libraries
  842. XE :=        # Executables
  843. XF := .f        # Fortran
  844. XO := .o        # Objects
  845. XP := .p        # Pascal
  846. XS := .s        # Assembler sources
  847. XV := ,v        # RCS suffix
  848. X
  849. X# Recipe execution configurations
  850. XSHELL        := /bin/sh
  851. XSHELLFLAGS    := -ce
  852. XGROUPSHELL    := $(SHELL)
  853. XGROUPFLAGS    := 
  854. XSHELLMETAS    := |();&<>?*][$$:\\#`'"
  855. XGROUPSUFFIX    :=
  856. X
  857. X# Standard C-language command names and flags
  858. X   CPP       := /lib/cpp        # C-preprocessor
  859. X   CC      := cc        # C-compiler and flags
  860. X   CFLAGS   =
  861. X
  862. X   AS      := as        # Assembler and flags
  863. X   ASFLAGS  = 
  864. X
  865. X   LD       = $(CC)        # Loader and flags
  866. X   LDFLAGS  =
  867. X   LDLIBS   =
  868. X
  869. X# Definition of $(MAKE) macro for recursive makes.
  870. X   MAKE = $(MAKECMD) $(MFLAGS)
  871. X
  872. X# Definition of Print command for this system.
  873. X   PRINT = lpr
  874. X
  875. X# Language and Parser generation Tools and their flags
  876. X   YACC      := yacc        # standard yacc
  877. X   YFLAGS  =
  878. X   YTAB      := y.tab        # yacc output files name stem.
  879. X
  880. X   LEX      := lex        # standard lex
  881. X   LFLAGS  =
  882. X   LEXYY  := lex.yy        # lex output file
  883. X
  884. X# Other Compilers, Tools and their flags
  885. X   PC    := pc            # pascal compiler
  886. X   RC    := f77            # ratfor compiler
  887. X   FC    := f77            # fortran compiler
  888. X
  889. X   CO       := co        # check out for RCS
  890. X   COFLAGS := -q
  891. X
  892. X   AR     := ar            # archiver
  893. X   ARFLAGS = ruv
  894. X
  895. X   RM       := /bin/rm        # remove a file command
  896. X   RMFLAGS  =
  897. X
  898. X# Implicit generation rules for making inferences.
  899. X# We don't provide .yr or .ye rules here.  They're obsolete.
  900. X# Rules for making *$O
  901. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  902. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  903. X   %$O : %$S ; $(AS) $<
  904. X   %$O : %.cl ; class -c $<
  905. X   %$O : %.e %.r %.F %$F
  906. X    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  907. X
  908. X# Executables
  909. X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  910. X
  911. X# lex and yacc rules
  912. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  913. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  914. X
  915. X# This rule tells how to make *.out from it's immediate list of prerequisites
  916. X# UNIX only.
  917. X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  918. X
  919. X# RCS support
  920. X.IF $(_HAVE_RCS)
  921. X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  922. X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  923. X.END
  924. X
  925. X# SCCS support
  926. X.IF $(_HAVE_SCCS)
  927. X   % : s.% ; get $@
  928. X   .NOINFER : s.%
  929. X.END
  930. X
  931. X# Recipe to make archive files.
  932. X%$A :
  933. X[
  934. X   $(AR) $(ARFLAGS) $@ $?
  935. X   $(RM) $(RMFLAGS) $?
  936. X   ranlib $@
  937. X]
  938. X
  939. X# DMAKE uses this recipe to remove intermediate targets
  940. X.REMOVE :; $(RM) -f $<
  941. X
  942. X# AUGMAKE extensions for SYSV compatibility
  943. X@B = $(@:b)
  944. X@D = $(@:d)
  945. X@F = $(@:f)
  946. X*B = $(*:b)
  947. X*D = $(*:d)
  948. X*F = $(*:f)
  949. X<B = $(<:b)
  950. X<D = $(<:d)
  951. X<F = $(<:f)
  952. X?B = $(?:b)
  953. X?F = $(?:f)
  954. X?D = $(?:d)
  955. X
  956. X# Turn warnings back to previous setting.
  957. X.SILENT := $(__.SILENT)
  958. X
  959. X# Local startup file if any
  960. X.INCLUDE .IGNORE: "_startup.mk"
  961. SHAR_EOF
  962. chmod 0640 unix/bsd43/dynix/startup.mk || echo "restore of unix/bsd43/dynix/startup.mk fails"
  963. echo "x - extracting unix/bsd43/dynix/make.sh (Text)"
  964. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/make.sh &&
  965. Xmkdir objects
  966. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O infer.c
  967. Xmv infer.o objects
  968. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O make.c
  969. Xmv make.o objects
  970. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O stat.c
  971. Xmv stat.o objects
  972. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O expand.c
  973. Xmv expand.o objects
  974. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O string.c
  975. Xmv string.o objects
  976. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O hash.c
  977. Xmv hash.o objects
  978. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dag.c
  979. Xmv dag.o objects
  980. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dmake.c
  981. Xmv dmake.o objects
  982. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O path.c
  983. Xmv path.o objects
  984. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O imacs.c
  985. Xmv imacs.o objects
  986. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O sysintf.c
  987. Xmv sysintf.o objects
  988. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O parse.c
  989. Xmv parse.o objects
  990. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O getinp.c
  991. Xmv getinp.o objects
  992. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O quit.c
  993. Xmv quit.o objects
  994. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O basename.c
  995. Xmv basename.o objects
  996. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O dump.c
  997. Xmv dump.o objects
  998. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O macparse.c
  999. Xmv macparse.o objects
  1000. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O rulparse.c
  1001. Xmv rulparse.o objects
  1002. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O percent.c
  1003. Xmv percent.o objects
  1004. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/arlib.c
  1005. Xmv arlib.o objects
  1006. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/dirbrk.c
  1007. Xmv dirbrk.o objects
  1008. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/explode.c
  1009. Xmv explode.o objects
  1010. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/rmprq.c
  1011. Xmv rmprq.o objects
  1012. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/ruletab.c
  1013. Xmv ruletab.o objects
  1014. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/runargv.c
  1015. Xmv runargv.o objects
  1016. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/putenv.c
  1017. Xmv putenv.o objects
  1018. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/tempnam.c
  1019. Xmv tempnam.o objects
  1020. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/utime.c
  1021. Xmv utime.o objects
  1022. Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/dynix -O unix/bsd43/setvbuf.c
  1023. Xmv setvbuf.o objects
  1024. Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o -lcfix 
  1025. SHAR_EOF
  1026. chmod 0640 unix/bsd43/dynix/make.sh || echo "restore of unix/bsd43/dynix/make.sh fails"
  1027. echo "x - extracting unix/bsd43/dynix/ctype.h (Text)"
  1028. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/ctype.h &&
  1029. X/*    ctype.h    4.2    85/09/04    */
  1030. X
  1031. X#define    _U    01
  1032. X#define    _L    02
  1033. X#define    _N    04
  1034. X#define    _S    010
  1035. X#define _P    020
  1036. X#define _C    040
  1037. X#define _X    0100
  1038. X#define    _B    0200
  1039. X
  1040. Xextern    char    _ctype_[];
  1041. X
  1042. X#define    isalpha(c)    ((_ctype_+1)[c]&(_U|_L))
  1043. X#define    isupper(c)    ((_ctype_+1)[c]&_U)
  1044. X#define    islower(c)    ((_ctype_+1)[c]&_L)
  1045. X#define    isdigit(c)    ((_ctype_+1)[c]&_N)
  1046. X#define    isxdigit(c)    ((_ctype_+1)[c]&(_N|_X))
  1047. X#define    isspace(c)    ((_ctype_+1)[c]&_S)
  1048. X#define ispunct(c)    ((_ctype_+1)[c]&_P)
  1049. X#define isalnum(c)    ((_ctype_+1)[c]&(_U|_L|_N))
  1050. X#define isprint(c)    ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
  1051. X#define isgraph(c)    ((_ctype_+1)[c]&(_P|_U|_L|_N))
  1052. X#define iscntrl(c)    ((_ctype_+1)[c]&_C)
  1053. X#define isascii(c)    ((unsigned)(c)<=0177)
  1054. X#define toupper(c)    ((c)-'a'+'A')
  1055. X#define tolower(c)    ((c)-'A'+'a')
  1056. X#define toascii(c)    ((c)&0177)
  1057. SHAR_EOF
  1058. chmod 0640 unix/bsd43/dynix/ctype.h || echo "restore of unix/bsd43/dynix/ctype.h fails"
  1059. echo "x - extracting unix/bsd43/dynix/config.mk (Text)"
  1060. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/dynix/config.mk &&
  1061. X# This is the SysV Dynix configuration file
  1062. X# for DMAKE
  1063. X#    It simply adds this dir as the dir to search for include files.
  1064. X#    so that this ctype.h file is found.
  1065. X#
  1066. X
  1067. XLDLIBS += -lcfix
  1068. XCFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
  1069. SHAR_EOF
  1070. chmod 0640 unix/bsd43/dynix/config.mk || echo "restore of unix/bsd43/dynix/config.mk fails"
  1071. echo "x - extracting unix/bsd43/config.mk (Text)"
  1072. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/config.mk &&
  1073. X# This is the BSD 4.3 UNIX configuration file for DMAKE
  1074. X#    It simply modifies the values of SRC, and checks to see if
  1075. X#    OSENVIRONMENT is defined.  If so it includes the appropriate
  1076. X#    config.mk file.
  1077. X#
  1078. X# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  1079. X# directory.
  1080. X#
  1081. Xosrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  1082. X
  1083. X# The following sources are required for BSD4.3
  1084. XOSDSRC := putenv.c tempnam.c utime.c setvbuf.c
  1085. XSRC    += $(OSDSRC)
  1086. X.SETDIR=$(osrdir) : $(OSDSRC)
  1087. X
  1088. X.SOURCE.h : $(osrdir)
  1089. X
  1090. X# Local configuration modifications for CFLAGS, there's local BSD includes
  1091. X# too.
  1092. XCFLAGS += -I$(osrdir)
  1093. X
  1094. X# See if we modify anything in the lower levels.
  1095. X.IF $(OSENVIRONMENT) != $(NULL)
  1096. X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
  1097. X.END
  1098. SHAR_EOF
  1099. chmod 0640 unix/bsd43/config.mk || echo "restore of unix/bsd43/config.mk fails"
  1100. echo "x - extracting unix/bsd43/config.h (Text)"
  1101. sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/config.h &&
  1102. X/* RCS      -- $Header$
  1103. X-- SYNOPSIS -- Configurarion include file.
  1104. X-- 
  1105. X-- DESCRIPTION
  1106. X--     There is one of these for each specific machine configuration.
  1107. X--    It can be used to further tweek the machine specific sources
  1108. X--    so that they compile.
  1109. X--
  1110. X-- AUTHOR
  1111. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1112. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1113. X--
  1114. X-- COPYRIGHT
  1115. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1116. X-- 
  1117. X--      This program is free software; you can redistribute it and/or
  1118. X--      modify it under the terms of the GNU General Public License
  1119. X--      (version 1), as published by the Free Software Foundation, and
  1120. X--      found in the file 'LICENSE' included with this distribution.
  1121. X-- 
  1122. X--      This program is distributed in the hope that it will be useful,
  1123. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1124. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1125. X--      GNU General Public License for more details.
  1126. X-- 
  1127. X--      You should have received a copy of the GNU General Public License
  1128. X--      along with this program;  if not, write to the Free Software
  1129. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1130. X--
  1131. X-- LOG
  1132. X--     $Log$
  1133. X*/
  1134. X
  1135. X/* define this for configurations that don't have the coreleft function
  1136. X * so that the code compiles.  To my knowledge coreleft exists only on
  1137. X * Turbo C, but it is needed here since the function is used in many debug
  1138. X * macros. */
  1139. X#define coreleft() 0L
  1140. X
  1141. X/* Define the getcwd function that is used in the code, since BSD does
  1142. X * not have getcwd, but call it getwd instead. */
  1143. Xextern    char*    getwd ANSI((char*));
  1144. X#define    getcwd(buf,siz)    getwd(buf)
  1145. SHAR_EOF
  1146. chmod 0640 unix/bsd43/config.h || echo "restore of unix/bsd43/config.h fails"
  1147. echo "x - extracting unix/arlib.c (Text)"
  1148. sed 's/^X//' << 'SHAR_EOF' > unix/arlib.c &&
  1149. X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/arlib.c,v 1.1 90/07/19 14:04:36 dvadura Exp $
  1150. X-- SYNOPSIS -- Unix archive manipulation code.
  1151. X-- 
  1152. X-- DESCRIPTION
  1153. X--     Originally this code was provided by Eric Gisin of MKS.  I took
  1154. X--    his code and completely rewrote it adding cacheing of lib members
  1155. X--    and other various optimizations.  I kept the overal functional
  1156. X--    idea of the library routines as they are similar to those in GNU
  1157. X--    make and felt it advantageous to maintain a similar interface.
  1158. X--
  1159. X-- AUTHOR
  1160. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1161. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1162. X--
  1163. X-- COPYRIGHT
  1164. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1165. X-- 
  1166. X--      This program is free software; you can redistribute it and/or
  1167. X--      modify it under the terms of the GNU General Public License
  1168. X--      (version 1), as published by the Free Software Foundation, and
  1169. X--      found in the file 'LICENSE' included with this distribution.
  1170. X-- 
  1171. X--      This program is distributed in the hope that it will be useful,
  1172. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1173. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1174. X--      GNU General Public License for more details.
  1175. X-- 
  1176. X--      You should have received a copy of the GNU General Public License
  1177. X--      along with this program;  if not, write to the Free Software
  1178. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1179. X--
  1180. X--      This program is free software; you can redistribute it
  1181. X--      and/or modify it under the terms of the GNU General
  1182. X--      Public License (version 1), as published by the Free
  1183. X--      Software Foundation, and found in the file 'license'
  1184. X--      included in this distribution.
  1185. X--
  1186. X--      This program is distributed in the hope that it will be
  1187. X--      useful, but WITHOUT ANY WARRANTY; without even the implied
  1188. X--      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  1189. X--      PURPOSE.  See the GNU General Public License for more
  1190. X--      details.
  1191. X--
  1192. X--      You should have received a copy of the GNU General Public
  1193. X--      License along with this program;  if not, write to the
  1194. X--      Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  1195. X--      MA 02139, USA.
  1196. X--
  1197. X-- LOG
  1198. X--     $Log:    arlib.c,v $
  1199. X * Revision 1.1  90/07/19  14:04:36  dvadura
  1200. X * Initial Revision of Version 3.5
  1201. X * 
  1202. X*/
  1203. X
  1204. X#include "extern.h"
  1205. X#include "sysintf.h"
  1206. X#include <ar.h>
  1207. X#include <stdio.h>
  1208. X
  1209. X/* By defining the defines below it is possible to configure the library
  1210. X * code for library cacheing/non-cacheing, ASCII archive headers, and a full
  1211. X * decode of the ar_hdr fields in the scan_ar function. */
  1212. X
  1213. X#define ASCARCH            1    /* ASCII time stored in archive    */
  1214. X#define LC            1    /* Turn on library cacheing    */
  1215. X#define DECODE_ALL_AR_FIELDS    0    /* decode only fields make needs*/
  1216. X
  1217. X#if LC
  1218. X#  define FOUND_MEMBER    FALSE
  1219. X#else
  1220. X#  define FOUND_MEMBER    TRUE
  1221. X#  define _cache_member(a, b, c)
  1222. X#  define _check_cache(a, b, c, d)    FALSE
  1223. X#endif
  1224. X
  1225. X#define    MAXFNAME    32    /* Longest file name in archive    */
  1226. X#define    MAXMNAME    8    /* Max module name < MAXFNAME    */
  1227. X
  1228. X
  1229. X/* This struct is used to pass the library and member information about the
  1230. X * routines that perform the library seeking/cacheing */
  1231. Xstruct ar_args {
  1232. X   char   *lib;
  1233. X   char   *member;
  1234. X   time_t time;
  1235. X};
  1236. X
  1237. X
  1238. Xtypedef struct AR {
  1239. X   char    ar_name[MAXFNAME+1];      /* File name */
  1240. X   long    ar_size;                  /* Size in bytes */
  1241. X   time_t  ar_time;                  /* Modification time */
  1242. X
  1243. X#ifdef DOS
  1244. X   char    ar_modname[MAXMNAME+1];   /* DOS module name */
  1245. X#endif
  1246. X
  1247. X#if DECODE_ALL_AR_FIELDS
  1248. X   uint16  ar_mode;                  /* File mode */
  1249. X   uint16  ar_uid;                     /* File owner */
  1250. X   uint16  ar_gid;                   /* File group owner */
  1251. X#endif
  1252. X} AR, *ARPTR;
  1253. X
  1254. X
  1255. Xstatic int ar_scan  ANSI((FILE *,
  1256. X              int (*) ANSI((FILE *, struct AR *, struct ar_args *)),
  1257. X              struct ar_args *));
  1258. Xstatic int ar_touch ANSI(( FILE *, time_t ));
  1259. Xstatic int time_function  ANSI(( FILE *, struct AR *, struct ar_args * ));
  1260. Xstatic int touch_function ANSI(( FILE *, struct AR *, struct ar_args * ));
  1261. X
  1262. X#if LC
  1263. Xstatic int _cache_member ANSI((char *, char *, time_t));
  1264. Xstatic int _check_cache  ANSI((char *, char *, time_t *, int));
  1265. X#endif
  1266. X
  1267. X/* decoded archive header */
  1268. Xstatic AR _ar;
  1269. X
  1270. X
  1271. Xtime_t
  1272. Xseek_arch(name, lib)/*
  1273. X======================
  1274. X   Look for module 'name' inside 'lib'.  If compiled with cacheing then first
  1275. SHAR_EOF
  1276. echo "End of part 2"
  1277. echo "File unix/arlib.c is continued in part 3"
  1278. echo "3" > s2_seq_.tmp
  1279. exit 0
  1280.  
  1281.